package es.udc.emarketapp.emarket.model.purchase.purchaseFacade.actions;

import es.udc.emarketapp.emarket.model.orderDetails.dao.SQLOrderDetailsDAO;
import es.udc.emarketapp.emarket.model.orderDetails.dao.SQLOrderDetailsDAOFactory;
import java.sql.Connection;

import es.udc.fbellas.j2ee.util.exceptions.InternalErrorException;
import es.udc.fbellas.j2ee.util.exceptions.ModelException;
import es.udc.fbellas.j2ee.util.sql.NonTransactionalPlainAction;

public class FindOrderDetailsByIdAction implements NonTransactionalPlainAction {

	private Long idOrder;

	public FindOrderDetailsByIdAction(Long idOrder) {
		this.idOrder = idOrder;
	}

	public Object execute(Connection connection) throws InternalErrorException,
			ModelException {

		SQLOrderDetailsDAO orderDAO = SQLOrderDetailsDAOFactory.getDAO();

		return orderDAO.findById(connection, idOrder);

	}
}
